package com.zy.di.pro1_value_annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@ComponentScan
@PropertySource(value={"classpath:product.properties"})  //指定properties文件的位置，让spring容器加载properties文件
public class AppTest_Value {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppTest_Value.class);
        Product product = context.getBean(Product.class);
        System.out.println(product);
    }
}
